﻿using System;
using System.Collections.Generic;

using GLSL;

namespace MosCraft.Graphics
{
    public class ChunkRender
    {
        public ChunkRender()
        {
        }

        public void updateVBOData(Chunk chunk)
        {
            if (chunk.solidVBOHandler == null)
            {
                chunk.solidVBOHandler = new VBO();
                chunk.translucentVBOHandler = new VBO();
            }

            chunk.solidVBOHandler.SetData(chunk.solidVertices);
            chunk.translucentVBOHandler.SetData(chunk.translucentVertices);
        }

        public void Render(Chunk chunk, RenderPass renderPass)
        {
            if (renderPass == RenderPass.Solids)
            {
                chunk.solidVBOHandler.Render();
            }
            else
            {
                chunk.translucentVBOHandler.Render();
            }
        }
    }
}
